﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Focus : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public string GetimageurlList()
    {
        string imageurl = "";
        string sql = "select top 6 id,title,pic from news where pic<>'' and classid=332 and  right(pic,3)='jpg' order by id desc";
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable(sql, dt);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            imageurl = imageurl + ("/admin/" + dt.Rows[i][2].ToString() + "|");
        }
        imageurl = imageurl.Substring(0, imageurl.Length - 1);
        return imageurl;
    }


    public string GetTitlelList()
    {
        string title = "";
        string sql = "select top 6 id,title,pic from news where pic<>'' and classid=332 and  right(pic,3)='jpg' order by id desc";
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable(sql, dt);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            title = title + (dt.Rows[i][1].ToString() + "|");
        }
        title = title.Substring(0, title.Length - 1);
        return title;
    }


    public string GetLinkList()
    {
        string links = "";
        string sql = "select top 6 id,title,pic from news where pic<>'' and classid=332 and  right(pic,3)='jpg' order by id desc";
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable(sql, dt);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            links = links + ("/news_show.aspx?id=" + dt.Rows[i][0].ToString() + "|");
        }
        links = links.Substring(0, links.Length - 1);
        return links;
    }
}
